package Song.Han.day03.demo04;

public class Demo02Student {
    public static void main(String[] args) {

        //new后面的 Student() 就是构造方法
        Student stu1 = new Student();
        System.out.println("-------------------");
        Student stu2 = new Student("张三",18);
        System.out.println("姓名："+stu2.getName()+"，年龄："+stu2.getAge());

        stu2.setAge(19);//改变了年龄
        System.out.println("姓名："+stu2.getName()+"，年龄："+stu2.getAge());

    }
}
